/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.templates;

import com.lineage.server.datatables.ItemTable;
import com.lineage.server.datatables.MagicDollTable;
import com.lineage.server.model.L1Character;
import com.lineage.server.model.Instance.L1DollInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.packetserver.S_SkillSound;
import com.lineage.server.utils.Random;

/**
 * Class <code>L1MagicDoll</code> 数据库模板:魔法娃娃.
 * 
 * @author jrwz
 * @version 2012-6-16下午04:38:27
 * @see com.lineage.server.templates
 * @since JDK1.7
 */
public final class L1MagicDoll {

    /**
     * 取得防御力增加(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 物理防御
     */
    public static int getAcByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getAc();
            }
        }
        return s;
    }

    /**
     * 取得弓的攻击力增加(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 远程攻击力
     */
    public static int getBowDamageByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getBowDmg();
            }
        }
        return s;
    }

    /**
     * 取得弓的命中率增加(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 远程命中率
     */
    public static int getBowHitAddByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getBowHit();
            }
        }
        return s;
    }

    /**
     * 取得近距离的攻击力增加(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 近距离攻击力
     */
    public static int getDamageAddByDoll(final L1Character master) {
        int s = 0;
        final int chance = Random.nextInt(100) + 1;
        boolean isAdd = false;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if ((doll.getDmgChance() > 0) && !isAdd) { // 额外伤害发动机率
                    if (doll.getDmgChance() >= chance) {
                        s += doll.getDmg();
                        isAdd = true;
                    }
                } else if (doll.getDmg() != 0) { // 额外伤害
                    s += doll.getDmg();
                }
            }
        }
        if (isAdd) {
            if (master instanceof L1PcInstance) {
                final L1PcInstance pc = (L1PcInstance) master;
                pc.sendPackets(new S_SkillSound(master.getId(), 6319));
            }
            master.broadcastPacket(new S_SkillSound(master.getId(), 6319));
        }
        return s;
    }

    /**
     * 取得伤害回避(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 伤害回避
     */
    public static int getDamageEvasionByDoll(final L1Character master) {
        final int chance = Random.nextInt(100) + 1;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getDmgEvasionChance() >= chance) { // 伤害回避发动机率
                    if (master instanceof L1PcInstance) {
                        final L1PcInstance pc = (L1PcInstance) master;
                        pc.sendPackets(new S_SkillSound(master.getId(), 6320));
                    }
                    master.broadcastPacket(new S_SkillSound(master.getId(),
                            6320));
                    return 1;
                }
            }
        }
        return 0;
    }

    /**
     * 取得伤害减免(魔法娃娃).
     * 
     * @param master
     *            主人
     * @return 伤害减免
     */
    public static int getDamageReductionByDoll(final L1Character master) {
        int s = 0;
        final int chance = Random.nextInt(100) + 1;
        boolean isReduction = false;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if ((doll.getDmgReductionChance() > 0) && !isReduction) { // 伤害减免发动机率
                    if (doll.getDmgReductionChance() >= chance) {
                        s += doll.getDmgReduction();
                        isReduction = true;
                    }
                } else if (doll.getDmgReduction() != 0) { // 伤害减免
                    s += doll.getDmgReduction();
                }
            }
        }
        if (isReduction) {
            if (master instanceof L1PcInstance) {
                final L1PcInstance pc = (L1PcInstance) master;
                pc.sendPackets(new S_SkillSound(master.getId(), 6320));
            }
            master.broadcastPacket(new S_SkillSound(master.getId(), 6320));
        }
        return s;
    }

    /**
     * 取得效果(魔法娃娃).
     * 
     * @param master
     *            主人
     * @param type
     *            类型
     * @return 效果
     */
    public static int getEffectByDoll(final L1Character master, final byte type) {
        final int chance = Random.nextInt(100) + 1;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll.getEffectChance() > chance) {
                if (doll != null) {
                    if (doll.getEffect() == type) {
                        return type;
                    }
                }
            }
        }
        return 0;
    }

    /**
     * 取得经验值增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 经验值
     */
    public static double getExpByDoll(final L1Character master) {
        double s = 1.0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getExp() > 0.0) {
                    s = doll.getExp();
                }
            }
        }
        return s;
    }

    /**
     * 取得近距离的命中率增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 近距离命中率
     */
    public static int getHitAddByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getHit();
            }
        }
        return s;
    }

    /**
     * 取得体力回覆量 (时间固定性) - (魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 体力回覆量
     */
    public static int getHpByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getHprTime() && (doll.getHpr() != 0)) {
                    s += doll.getHpr();
                }
            }
        }
        return s;
    }

    /**
     * 取得体力回覆量(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 体力回覆量
     */
    public static int getHprByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (!doll.getHprTime() && (doll.getHpr() != 0)) {
                    s += doll.getHpr();
                }
            }
        }
        return s;
    }

    /**
     * 取得道具(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 获得的道具
     */
    public static int getMakeItemId(final L1Character master) {
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                final L1Item item = ItemTable.getInstance().getTemplate(
                        (doll.getMakeItemId()));
                if (item != null) {
                    return item.getItemId();
                }
            }
        }
        return 0;
    }

    /**
     * 取得魔力回覆量 (时间固定性) - (魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 回覆量
     */
    public static int getMpByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getMprTime() && (doll.getMpr() != 0)) {
                    s += doll.getMpr();
                }
            }
        }
        return s;
    }

    /**
     * 取得魔力回覆量(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 回覆量
     */
    public static int getMprByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (!doll.getMprTime() && (doll.getMpr() != 0)) {
                    s += doll.getMpr();
                }
            }
        }
        return s;
    }

    /**
     * 取得闇黑耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 闇黑耐性
     */
    public static int getRegistBlindByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistBlind();
            }
        }
        return s;
    }

    /**
     * 取得寒冰耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 寒冰耐性
     */
    public static int getRegistFreezeByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistFreeze();
            }
        }
        return s;
    }

    /**
     * 取得睡眠耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 睡眠耐性
     */
    public static int getRegistSleepByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistSleep();
            }
        }
        return s;
    }

    /**
     * 取得石化耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 石化耐性
     */
    public static int getRegistStoneByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistStone();
            }
        }
        return s;
    }

    /**
     * 取得昏迷耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 昏迷耐性
     */
    public static int getRegistStunByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistStun();
            }
        }
        return s;
    }

    /**
     * 取得支撑耐性增加(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 支撑耐性
     */
    public static int getRegistSustainByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getRegistSustain();
            }
        }
        return s;
    }

    /**
     * 取得负重减轻(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return 负重减轻
     */
    public static int getWeightReductionByDoll(final L1Character master) {
        int s = 0;
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                s += doll.getWeightReduction();
            }
        }
        return s;
    }

    /**
     * 回血判断 (时间固定性) - (魔法娃娃).
     * 
     * @param master
     *            对象
     * @return true or false
     */
    public static boolean isHpRegeneration(final L1Character master) {
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getHprTime() && (doll.getHpr() != 0)) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * 是否创造道具(魔法娃娃).
     * 
     * @param master
     *            对象
     * @return true or false
     */
    public static boolean isItemMake(final L1Character master) {
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                final L1Item item = ItemTable.getInstance().getTemplate(
                        (doll.getMakeItemId()));
                if (item != null) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * 回魔判断 (时间固定性) - (魔法娃娃).
     * 
     * @param master
     *            对象
     * @return true or false
     */
    public static boolean isMpRegeneration(final L1Character master) {
        for (final L1DollInstance dollIns : master.getDollList().values()) {
            final L1MagicDoll doll = MagicDollTable.getInstance().getTemplate(
                    dollIns.getItemId());
            if (doll != null) {
                if (doll.getMprTime() && (doll.getMpr() != 0)) {
                    return true;
                }
            }
        }
        return false;
    }

    /** 道具ID. */
    private int itemId;
    /** 娃娃ID. */
    private int dollId;
    /** 物理防御. */
    private int ac;
    /** 回血. */
    private int hpr;
    /** 回魔. */
    private int mpr;
    /** 回血时间. */
    private boolean hprTime;
    /** 回魔时间. */
    private boolean mprTime;
    /** 伤害. */
    private int dmg;
    /** 弓伤害. */
    private int bowDmg;
    /** 伤害几率. */
    private int dmgChance;
    /** 命中率. */
    private int hit;
    /** 弓的命中率. */
    private int bowHit;
    /** 伤害减免. */
    private int dmgReduction;
    /** 伤害减免的几率. */
    private int dmgReductionChance;
    /** 伤害回避. */
    private int dmgEvasionChance;
    /** 负重轻减. */
    private int weightReduction;
    /** 昏迷耐性. */
    private int registStun;
    /** 石化耐性. */
    private int registStone;
    /** 睡眠耐性. */
    private int registSleep;
    /** 寒冰耐性. */
    private int registFreeze;
    /** 支撑耐性. */
    private int registSustain;
    /** 闇黑耐性. */
    private int registBlind;
    /** 取得道具. */
    private int makeItemId;
    /** 效果. */
    private byte effect;
    /** 效果几率. */
    private int effectChance;
    /** 经验值. */
    private double exp;

    /**
     * 取得AC.
     * 
     * @return 物理防御
     */
    public int getAc() {
        return this.ac;
    }

    /**
     * 取得弓伤害.
     * 
     * @return 弓伤害
     */
    public int getBowDmg() {
        return this.bowDmg;
    }

    /**
     * 取得弓的命中率.
     * 
     * @return 弓的命中率
     */
    public int getBowHit() {
        return this.bowHit;
    }

    /**
     * 取得伤害.
     * 
     * @return 伤害
     */
    public int getDmg() {
        return this.dmg;
    }

    /**
     * 取得伤害几率.
     * 
     * @return 伤害几率
     */
    public int getDmgChance() {
        return this.dmgChance;
    }

    /**
     * 取得伤害回避.
     * 
     * @return 伤害回避
     */
    public int getDmgEvasionChance() {
        return this.dmgEvasionChance;
    }

    /**
     * 取得伤害减免.
     * 
     * @return 伤害减免
     */
    public int getDmgReduction() {
        return this.dmgReduction;
    }

    /**
     * 取得伤害减免的几率.
     * 
     * @return 伤害减免的几率
     */
    public int getDmgReductionChance() {
        return this.dmgReductionChance;
    }

    /**
     * 取得娃娃ID.
     * 
     * @return 娃娃ID
     */
    public int getDollId() {
        return this.dollId;
    }

    /**
     * 取得效果.
     * 
     * @return 效果
     */
    public byte getEffect() {
        return this.effect;
    }

    /**
     * 取得效果几率.
     * 
     * @return 效果几率
     */
    public int getEffectChance() {
        return this.effectChance;
    }

    /**
     * 取得经验值.
     * 
     * @return 经验值
     */
    public double getExp() {
        return this.exp;
    }

    /**
     * 取得命中率.
     * 
     * @return 命中率
     */
    public int getHit() {
        return this.hit;
    }

    /**
     * 取得回血.
     * 
     * @return 回血
     */
    public int getHpr() {
        return this.hpr;
    }

    /**
     * 取得回血时间.
     * 
     * @return 回血时间
     */
    public boolean getHprTime() {
        return this.hprTime;
    }

    /**
     * 取得道具ID.
     * 
     * @return 道具ID
     */
    public int getItemId() {
        return this.itemId;
    }

    /**
     * 取得道具.
     * 
     * @return 道具
     */
    public int getMakeItemId() {
        return this.makeItemId;
    }

    /**
     * 取得回魔.
     * 
     * @return 回魔
     */
    public int getMpr() {
        return this.mpr;
    }

    /**
     * 取得回魔时间.
     * 
     * @return 回魔时间
     */
    public boolean getMprTime() {
        return this.mprTime;
    }

    /**
     * 取得闇黑耐性.
     * 
     * @return 闇黑耐性
     */
    public int getRegistBlind() {
        return this.registBlind;
    }

    /**
     * 取得寒冰耐性.
     * 
     * @return 寒冰耐性
     */
    public int getRegistFreeze() {
        return this.registFreeze;
    }

    /**
     * 取得睡眠耐性.
     * 
     * @return 睡眠耐性
     */
    public int getRegistSleep() {
        return this.registSleep;
    }

    /**
     * 取得石化耐性.
     * 
     * @return 石化耐性
     */
    public int getRegistStone() {
        return this.registStone;
    }

    /**
     * 取得昏迷耐性.
     * 
     * @return 昏迷耐性
     */
    public int getRegistStun() {
        return this.registStun;
    }

    /**
     * 取得支撑耐性.
     * 
     * @return 支撑耐性
     */
    public int getRegistSustain() {
        return this.registSustain;
    }

    /**
     * 取得负重轻减.
     * 
     * @return 负重轻减
     */
    public int getWeightReduction() {
        return this.weightReduction;
    }

    /**
     * 设置AC.
     * 
     * @param i
     *            AC
     */
    public void setAc(final int i) {
        this.ac = i;
    }

    /**
     * 设置弓伤害.
     * 
     * @param i
     *            弓伤害
     */
    public void setBowDmg(final int i) {
        this.bowDmg = i;
    }

    /**
     * 设置弓的命中率.
     * 
     * @param i
     *            弓的命中率
     */
    public void setBowHit(final int i) {
        this.bowHit = i;
    }

    /**
     * 设置伤害.
     * 
     * @param i
     *            伤害
     */
    public void setDmg(final int i) {
        this.dmg = i;
    }

    /**
     * 设置伤害几率.
     * 
     * @param i
     *            伤害几率
     */
    public void setDmgChance(final int i) {
        this.dmgChance = i;
    }

    /**
     * 设置伤害回避.
     * 
     * @param i
     *            伤害回避
     */
    public void setDmgEvasionChance(final int i) {
        this.dmgEvasionChance = i;
    }

    /**
     * 设置伤害减免.
     * 
     * @param i
     *            伤害减免
     */
    public void setDmgReduction(final int i) {
        this.dmgReduction = i;
    }

    /**
     * 设置伤害减免的几率.
     * 
     * @param i
     *            伤害减免的几率
     */
    public void setDmgReductionChance(final int i) {
        this.dmgReductionChance = i;
    }

    /**
     * 设置娃娃ID.
     * 
     * @param i
     *            娃娃ID
     */
    public void setDollId(final int i) {
        this.dollId = i;
    }

    /**
     * 设置效果.
     * 
     * @param i
     *            效果
     */
    public void setEffect(final byte i) {
        this.effect = i;
    }

    /**
     * 设置效果几率.
     * 
     * @param i
     *            效果几率
     */
    public void setEffectChance(final int i) {
        this.effectChance = i;
    }

    /**
     * 设置经验值.
     * 
     * @param i
     *            经验值
     */
    public void setExp(final double i) {
        this.exp = i;
    }

    /**
     * 设置命中率.
     * 
     * @param i
     *            命中率
     */
    public void setHit(final int i) {
        this.hit = i;
    }

    /**
     * 设置回血.
     * 
     * @param i
     *            回血
     */
    public void setHpr(final int i) {
        this.hpr = i;
    }

    /**
     * 设置回血时间.
     * 
     * @param i
     *            回血时间
     */
    public void setHprTime(final boolean i) {
        this.hprTime = i;
    }

    /**
     * 设置道具ID.
     * 
     * @param i
     *            道具ID
     */
    public void setItemId(final int i) {
        this.itemId = i;
    }

    /**
     * 设置取得道具.
     * 
     * @param i
     *            取得道具
     */
    public void setMakeItemId(final int i) {
        this.makeItemId = i;
    }

    /**
     * 设置回魔 .
     * 
     * @param i
     *            回魔
     */
    public void setMpr(final int i) {
        this.mpr = i;
    }

    /**
     * 设置回魔时间.
     * 
     * @param i
     *            回魔时间
     */
    public void setMprTime(final boolean i) {
        this.mprTime = i;
    }

    /**
     * 设置闇黑耐性.
     * 
     * @param i
     *            闇黑耐性
     */
    public void setRegistBlind(final int i) {
        this.registBlind = i;
    }

    /**
     * 设置寒冰耐性.
     * 
     * @param i
     *            寒冰耐性
     */
    public void setRegistFreeze(final int i) {
        this.registFreeze = i;
    }

    /**
     * 设置睡眠耐性.
     * 
     * @param i
     *            睡眠耐性
     */
    public void setRegistSleep(final int i) {
        this.registSleep = i;
    }

    /**
     * 设置石化耐性.
     * 
     * @param i
     *            石化耐性
     */
    public void setRegistStone(final int i) {
        this.registStone = i;
    }

    /**
     * 设置昏迷耐性.
     * 
     * @param i
     *            昏迷耐性
     */
    public void setRegistStun(final int i) {
        this.registStun = i;
    }

    /**
     * 设置支撑耐性.
     * 
     * @param i
     *            支撑耐性
     */
    public void setRegistSustain(final int i) {
        this.registSustain = i;
    }

    /**
     * 设置负重轻减.
     * 
     * @param i
     *            负重轻减
     */
    public void setWeightReduction(final int i) {
        this.weightReduction = i;
    }
}
